/**
 * Created by 小敏哥 on 2017/12/6.
 */
import React, {Component} from 'react';
import style from './index.scss';
import ItemList from '../../../../../../../../src/js/components/itemList';
import InputWithDelete from '../../../../../../../js/components/inputWithDelete';
import AddressPicker from '../../../../../../../js/components/addressPicker';

class InputContent extends Component {
    constructor(props) {
        super(props);
    }

    static propTypes = {
        driverNameCallBack: React.PropTypes.func.isRequired,//驾驶人姓名回调
        driverIdCardCallBack: React.PropTypes.func.isRequired,//驾驶人身份证回调
    };

    render() {
        return <div className={style.inputContent}>
            <p className={style.title}><img src="./images/Rectangle 2.png"/> 驾驶证信息</p>
            <AddressPicker colCount={1}/>
            <ItemList borderPaddingLeft="20px">
                <InputWithDelete storageKey="driverName" title="驾驶人姓名 " regular="^[\u4e00-\u9fa5]+$" maxLength={12}
                                 placeholder="请输入驾驶人姓名"
                                 errorCallBack={(value) => {
                                     this.props.driverNameCallBack(value, false);
                                 }} currentCallBack={(value) => {
                    this.props.driverNameCallBack(value, true);
                }}/>
                <InputWithDelete storageKey="driverIdCard" title="身份证号 " regular="^[\u4e00-\u9fa5]+$" maxLength={12}
                                     placeholder="请输入身份证号"
                                     errorCallBack={(value) => {
                                         this.props.driverIdCardCallBack(value, false);
                                     }} currentCallBack={(value) => {
                this.props.driverIdCardCallBack(value, true);
            }}/>
            </ItemList>
        </div>
    }
}

export default InputContent;